using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace DataAccess
{
    public enum p_USER_PROFILE_FIELD
    {
        EMPNO,
		EMPNAME,
		PASSWORD,
		DIVISION,
		EMAIL,
		TEL,
		STATUS,
		EXPIREDATE,
		CRDATE,
		CRBY,
		UPDDATE,
		UPDBY,
		POSITION,
		PDAFLAG,
		EMPID,
		OU_CODE,
		LANG,
		COMP_CODE
    }

    public class p_USER_PROFILE : AbstractProperty
    {
        private OPERATOR CONDITION = OPERATOR.AND; //AND = Default
        private string string_criteria = "";
        private List<Hashtable> hashtable_criteria = new List<Hashtable>();
        private int cal_criteria = 0;

        public string EMPNO { get; set; }
		public string EMPNAME { get; set; }
		public string PASSWORD { get; set; }
		public string DIVISION { get; set; }
		public string EMAIL { get; set; }
		public string TEL { get; set; }
		public string STATUS { get; set; }
		public DateTime EXPIREDATE { get; set; }
		public DateTime CRDATE { get; set; }
		public string CRBY { get; set; }
		public DateTime UPDDATE { get; set; }
		public string UPDBY { get; set; }
		public string POSITION { get; set; }
		public string PDAFLAG { get; set; }
		public string EMPID { get; set; }
		public string OU_CODE { get; set; }
		public string LANG { get; set; }
		public string COMP_CODE { get; set; }

        public override string getStringCriteria()
        {
            return string_criteria.ToLower().Replace("where", "");
        }

        public override List<Hashtable> getHashtableCriteria()
        {
            return hashtable_criteria;
        }

        public override void setCriteria(string cmd)
        {
            this.string_criteria = cmd;
        }

        public override void setCriteria(Enum column_name, CRITERIA_FLAG cf, object Value)
        {
            cal_criteria++;
            Hashtable h = new Hashtable();
            h.Add(column_name.ToString() + cf.GetDescription().Replace("{val}", ":cri_" + cal_criteria.ToString() + column_name.ToString()), ":cri_" + cal_criteria.ToString() + column_name.ToString() + "๐" + Value);
            this.hashtable_criteria.Add(h);
        }

        public override void clearCriteria()
        {
            cal_criteria = 0;
            this.string_criteria = "";
            this.hashtable_criteria.Clear();
        }

        public override string getOperator()
        {
            return this.CONDITION.ToString();
        }

        public override void setOperator(OPERATOR obj)
        {
            this.CONDITION = obj;
        }
    }
}
